-- GENERATED SPELL FOR [Stonehearth Marshal] --


function spell0_14765(pUnit, Event) --@Charge,n/a--
pUnit:FullCastSpellOnTarget(22911,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_14765', 2281, 1)
end

function spell1_14765(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(40504,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_14765', 548, 1)
end

function spell2_14765(pUnit, Event) --@Demoralizing Shout,Self--
pUnit:FullCastSpellOnTarget(23511,pUnit)
pUnit:RegisterEvent('Sorts_14765', 30276, 1)
end

function spell3_14765(pUnit, Event) --@Enrage,Self--
pUnit:FullCastSpellOnTarget(8599,pUnit)
pUnit:RegisterEvent('Sorts_14765', 636, 1)
end

function spell4_14765(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(15589,pUnit)
pUnit:RegisterEvent('Sorts_14765', 614, 1)
end

function spell5_14765(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(13736,pUnit)
pUnit:RegisterEvent('Sorts_14765', 2000, 1)
end

function Sorts_14765(pUnit, Event)
local choix_sorts_14765 = math.random(0, 5)
if choix_sorts_14765 == 0 then
pUnit:RegisterEvent('spell0_14765', 1, 1)
end
if choix_sorts_14765 == 1 then
pUnit:RegisterEvent('spell1_14765', 1, 1)
end
if choix_sorts_14765 == 2 then
pUnit:RegisterEvent('spell2_14765', 1, 1)
end
if choix_sorts_14765 == 3 then
pUnit:RegisterEvent('spell3_14765', 1, 1)
end
if choix_sorts_14765 == 4 then
pUnit:RegisterEvent('spell4_14765', 1, 1)
end
if choix_sorts_14765 == 5 then
pUnit:RegisterEvent('spell5_14765', 1, 1)
end
end

function mob14765_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_14765', math.random(1500, 3000), 1)
end

function mob14765_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob14765_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob14765_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(14765, 1, 'mob14765_Action')
RegisterUnitEvent(14765, 2, 'mob14765_Leave')
RegisterUnitEvent(14765, 3, 'mob14765_Kill')
RegisterUnitEvent(14765, 4, 'mob14765_Die')
